package com.ceres.customer.dao;

import com.ceres.customer.pojo.Customer;
import com.ceres.entity.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Component
public interface CustMapper extends Mapper<Customer> {

    //模糊查询农业组织
    @Select("<script>select * from t_customer <if test=\"keyword!=null and keyword!=''\">where name=#{keyword} or code=#{keyword} or address=#{keyword} or contacts=#{keyword} or phone=#{keyword} or email=#{keyword}</if></script>")
    List<Customer> findByKeyWord(@Param("keyword") String keyword);
}
